package com.info.zhiduoduo.repository.dto.crowdsource;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

@Data
@Accessors(chain = true)
public class CrowdsourceProjectItemModel {

    @ApiModelProperty("众包项目条目id")
    private Integer projectItemId;
    @ApiModelProperty("导入excel的序号")
    private int row;
    @ApiModelProperty("用户id 众包自然人crowdsourceid 或 工作室userid")
    private int userid;
    @ApiModelProperty("用户类型 1:众包自然人 2:众包工作室")
    private int userType;
    @JsonIgnore
    @ApiModelProperty("用户姓名")
    private String realname;
    @JsonIgnore
    @ApiModelProperty("用户银行账户")
    private String acctno;
    private BigDecimal projectAmount;

    public CrowdsourceProjectItemModel(int row, int userid, int userType, BigDecimal projectAmount) {
        this.row = row;
        this.userid = userid;
        this.userType = userType;
        this.projectAmount = projectAmount;
    }

    public CrowdsourceProjectItemModel() {
    }

    public CrowdsourceProjectItemModel format(CrowdsourceProjectItemModel cp) {
        CrowdsourceProjectItemModel c = new CrowdsourceProjectItemModel();
        c.setUserid(cp.getUserid());
        c.setUserType(cp.getUserType());
        c.setRealname(cp.getRealname());
        c.setAcctno(cp.getAcctno());
        c.setProjectAmount(cp.getProjectAmount());
        return c;
    }
}
